<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jQuery/jquery-1.12.4.min.js" charset="utf-8"></script>
    <script type="text/javascript">



        function getSameId(prefix, index){
            var inputId = $("#" + prefix + index);
            return inputId.val();
        }


        $(function () {
            console.log(getSameId("abc_", 1) + " "+ getSameId("abc_", 2) + " "+ getSameId("abc_", 3) + " " + getSameId("abc_", 4));



            return;
            var userName, userAge, userSex, isSingle;
            var inputArray = $("input");
            var studets = new Array();
            //总共只有4列
            var len = inputArray.length;
            for (var i = 0; i < len; i++) {
                if (i % 4 == 0) {
                    userName = inputArray[i].value;
                }
                if (i % 4 == 1) {
                    userAge = inputArray[i].value;
                }
                if (i % 4 == 2) {
                    userSex = inputArray[i].value;
                }
                 if (i % 4 == 3) {
                    isSingle = inputArray[i].value;
                    var student = {
                        "userName": userName,
                        "userAge": userAge,
                        "userSex": userSex,
                        "isSingle": isSingle
                    };
                     studets.push(student);
                }
            }
            studets = JSON.stringify(studets);
            console.log(studets);


        });


    </script>
</head>
<body>


<div>

    <input type="text" id="abc_1" value="a"/>
    <input type="text" id="abc_2" value="b"/>
    <input type="text" id="abc_3" value="c"/>
    <input type="text" id="abc_4" value="d"/>

    <form action="" method="post">
        <input type="button" value="确定"/>
    </form>
    <div style="width: 800px;text-align: center;height: 60px;">
        <div style="float: left;width: 200px;">
            <h3><label>姓名</label></h3>
        </div>
        <div style="float: left;width: 200px;">
            <h3><label>年龄</label></h3>
        </div>
        <div style="float: left;width: 200px;">
            <h3><label>性别</label></h3>
        </div>
        <div style="float: left;width: 200px;">
            <h3><label>是否单身</label></h3>
        </div>
    </div>

    <div style="width: 800px;height: 20px;margin-top: 10px;">
        <div style="float: left;width: 200px;">
            <input type="text" value="汤姆"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="23"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="男"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="是"/>
        </div>
    </div>
    <div style="width: 800px;height: 20px;margin-top: 10px;">
        <div style="float: left;width: 200px;">
            <input type="text" value="杰瑞"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="22"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="男"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="否"/>
        </div>
    </div>
    <div style="width: 800px;height: 20px;margin-top: 10px;">
        <div style="float: left;width: 200px;">
            <input type="text" value="莉莉"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="22"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="女"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="否"/>
        </div>
    </div>
    <div style="width: 800px;height: 20px;margin-top: 10px;">
        <div style="float: left;width: 200px;">
            <input type="text" value="汉克斯"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="22"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="男"/>
        </div>
        <div style="float: left;width: 200px;">
            <input type="text" value="否"/>
        </div>
    </div>

</div>
</body>
</html>